home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / WXLSLIB.ARJ / AIRCRAFT.LSP < prev    next >
Lisp/Scheme  |  1992-02-20  |  776b  |  21 lines

  1. (def failure-times
  2.      '((413 14 58 37 100 65 9 169 447 184 36 201 118 34 31 
  3.             18 18 67 57 62 7 22 34)
  4.        (90 10 60 186 61 49 14 24 56 20 79 84 44 59 29 118 25 156 
  5.            310 76 26 44 23 62 130 208 70 101 208)
  6.        (74 57 48 29 502 12 70 21 29 386 59 27 153 26 326)
  7.        (55 320 65 104 220 239 47 246 176 182 33 15 104 35)
  8.        (23 261 87 7 120 14 62 47 225 71 246 21 42 20 5 12 120 
  9.            11 3 14 71 11 14 11 16 90 1 16 52 95)))
  10.  
  11. (def x (select failure-times 1))
  12.  
  13. (defun gllik (theta)
  14.   (let* ((mu (select theta 0))
  15.          (beta (select theta 1))
  16.          (n (length x))
  17.          (bym (* x (/ beta mu))))
  18.     (+ (* n (- (log beta) (log mu) (log-gamma beta)))
  19.        (sum (* (- beta 1) (log bym)))
  20.        (sum (- bym)))))
  21.